<template>
  <el-card>
    base/paper/index
    <el-form>
      <div
        v-for="item in total"
        :key="item"
        class="text item"
      >
        <el-col :span="3">
          <el-form-item>
            <el-button
              :label="item"
              border
              @click="handleClick(item)"
            >{{item}}
            </el-button>
          </el-form-item>
        </el-col>

      </div>

    </el-form>
  </el-card>
</template>

<script>
import * as PaperApi from '@/api/base/paper'
import axios from 'axios'

export default {
  name: 'paper',
  data() {
    return {
      radio1: '1',
      total: 0,
      url: '',
      entity: {
        items: [
          { num: 'A', content: '11' },
          { num: 'B', content: '22' },
          { num: 'C', content: '33' },
          { num: 'D', content: '44' }
        ]
      }
    }
  },
  created() {
    this.init()
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      const actionUrl = this.HOST + '/base/answer-base-paper-item' + '/getCount'
      axios({
        url: actionUrl,
        method: 'post',
        params: { paperId: 1 }
      }).then(response => {
        console.log('response')
        console.log(response)
        this.total = response.data
      })
    },
    handleClick(data) {
      if (data) {
        // 跳转试题
        this.$router.push({          path: '/base/paper-item' + '/initEditPage?id=' + data
        })
      }
    }
  }
}
</script>
